/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package trefliq.persistence.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
//import javax.validation.constraints.NotNull;

/**
 *
 * @author Adam Gojdas
 */
@Embeddable
public class MovieCreditPK implements Serializable {
    @Basic(optional = false)
//    @NotNull
    @Column(name = "MOVIEID", nullable = false)
    private long movieid;
    @Basic(optional = false)
//    @NotNull
    @Column(name = "SHOWBIZPEOPLEID", nullable = false)
    private long showbizpeopleid;
    @Basic(optional = false)
//    @NotNull
    @Column(name = "CREDITID", nullable = false)
    private long creditid;

    public MovieCreditPK() {
    }

    public MovieCreditPK(long movieid, long showbizpeopleid, long creditid) {
        this.movieid = movieid;
        this.showbizpeopleid = showbizpeopleid;
        this.creditid = creditid;
    }

    public long getMovieid() {
        return movieid;
    }

    public void setMovieid(long movieid) {
        this.movieid = movieid;
    }

    public long getShowbizpeopleid() {
        return showbizpeopleid;
    }

    public void setShowbizpeopleid(long showbizpeopleid) {
        this.showbizpeopleid = showbizpeopleid;
    }

    public long getCreditid() {
        return creditid;
    }

    public void setCreditid(long creditid) {
        this.creditid = creditid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) movieid;
        hash += (int) showbizpeopleid;
        hash += (int) creditid;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MovieCreditPK)) {
            return false;
        }
        MovieCreditPK other = (MovieCreditPK) object;
        if (this.movieid != other.movieid) {
            return false;
        }
        if (this.showbizpeopleid != other.showbizpeopleid) {
            return false;
        }
        if (this.creditid != other.creditid) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "se554.grp3.adg.MovieCreditPK[ movieid=" + movieid + ", showbizpeopleid=" + showbizpeopleid + ", creditid=" + creditid + " ]";
    }
    
}
